package com.wufei.tastefor.fragment;


import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.facebook.drawee.view.SimpleDraweeView;
import com.wufei.tastefor.R;
import com.wufei.tastefor.bean.HotMenu;

/**
 * A simple {@link Fragment} subclass.
 */
public class BlankFragment extends Fragment {


    private SimpleDraweeView itemfirstvpiicon;
    private SimpleDraweeView usericon;

    private RelativeLayout homefirstcontainer;
    private TextView homefirstuser;
    private TextView homefirstname;
    private TextView homefirsthot;

    private HotMenu hotMenu;

    public static BlankFragment newInstance(HotMenu hot) {

        Bundle args = new Bundle();
        args.putSerializable("hot", hot);
        BlankFragment fragment = new BlankFragment();
        fragment.setArguments(args);
        return fragment;
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_blank, container, false);
         initView(view);
        return view;
    }

    private void initView(View view) {
        hotMenu = (HotMenu) getArguments().getSerializable("hot");
        itemfirstvpiicon = (SimpleDraweeView) view.findViewById(R.id.item_first_vpi_icon);
        usericon = (SimpleDraweeView) view.findViewById(R.id.home_first_user_icon);
        homefirstcontainer = (RelativeLayout) view.findViewById(R.id.home_first_container);
        homefirstuser = (TextView) view.findViewById(R.id.home_first_user);
        homefirstname = (TextView) view.findViewById(R.id.home_first_name);
        homefirsthot = (TextView) view.findViewById(R.id.home_first_hot);

        itemfirstvpiicon.setImageURI(Uri.parse(hotMenu.getMenuPic()));
        usericon.setImageURI(Uri.parse(hotMenu.getUserIcon()));
        homefirstname.setText(hotMenu.getMenuTitle());
        homefirstuser.setText(hotMenu.getUserName());
        homefirsthot.setText(hotMenu.getMenuType());
        homefirstcontainer.getBackground().setAlpha(30);



    }


}
